﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Files.aspx.cs" Inherits="Excel_Files" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
    </ext:ResourceManager>
    <ext:Viewport runat="server" Layout="fit">
        <Items>
            <ext:GridPanel runat="server">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button runat="server" Text="上传Excel" Icon="PageWhiteExcel">
                                <DirectEvents>
                                    <Click OnEvent="ShowExcelDialog"></Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Store>
                    <ext:Store runat="server" ID="Store1">
                        <Model>
                            <ext:Model runat="server" IDProperty="ID">
                                <Fields>
                                    <ext:ModelField Name="ID"></ext:ModelField>
                                    <ext:ModelField Name="Filepath"></ext:ModelField>
                                    <ext:ModelField Name="FileName"></ext:ModelField>
                                    <ext:ModelField Name="isRows"></ext:ModelField>
                                    <ext:ModelField Name="isExport"></ext:ModelField>
                                    <ext:ModelField Name="inTime" Type="Date"></ext:ModelField> 
                                </Fields>
                            </ext:Model>
                        </Model> 
                    </ext:Store>
                </Store>
                <ColumnModel>
                    <Columns>
                        <ext:Column runat="server" DataIndex="ID" Text="编号"></ext:Column>
                        <ext:Column runat="server" DataIndex="FileName" Text="文件名称"></ext:Column>
                        <ext:Column runat="server" DataIndex="isRows" Text="数据量"></ext:Column>
                        <ext:Column runat="server" DataIndex="isExport" Text="是否导入"></ext:Column>
                        <ext:DateColumn runat="server" DataIndex="inTime" Text="时间" Format="yyyy-MM-dd"></ext:DateColumn> 
                        <ext:CommandColumn runat="server">
                            <Commands>
                                <ext:GridCommand runat="server" CommandName="Add" Icon="ArrowIn" Text="入库">
                                    
                                </ext:GridCommand>
                            </Commands>
                            <DirectEvents>
                                <Command OnEvent="Imports">
                                    <ExtraParams>
                                        <ext:Parameter Name="id" Value="record.data.ID" Mode="Raw" />
                                    </ExtraParams>
                                </Command>
                            </DirectEvents>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                 <DirectEvents>
                     
                 </DirectEvents>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    <ext:Window ID="Window1" runat="server" Collapsible="False" Hidden="True" Modal="True" Height="120" Icon="Attach" Collapsed="False"
        Title="文件上传" Layout="Fit" Width="400">
        <Items>
            <ext:FormPanel ID="FormPanel1" runat="server" ButtonAlign="Right" Height="85" Padding="5"
                 Width="300">
                <Items>
                    <ext:FileUploadField 
                    ID="txtFileUpload" 
                    runat="server" 
                    EmptyText="选择Excel"
                    FieldLabel="路径"
                    ButtonText=""
                    Padding="15"
                    LabelAlign="Right"
                    LabelWidth="50"
                    AnchorHorizontal="98%"
                    Icon="Attach"
                    />
                </Items>
                <Buttons>
                    <ext:Button ID="Button1" runat="server" Icon="Disk" Text="上传">
                        <DirectEvents>
                             <Click OnEvent="UploadFiles"></Click>
                        </DirectEvents>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </Items>
    </ext:Window>
    </form>
</body>
</html>
